package hut.game.sound;

import hut.game.Option;
import android.content.Context;
import android.media.MediaPlayer;

public class Music_main {
	private static MediaPlayer mp_main = null;

	public static void play_main(Context context, int resource) {
		if (Option.getMusic(context)) {
			mp_main = MediaPlayer.create(context, resource);
			mp_main.setLooping(true);
			mp_main.setVolume(1, 1);
			mp_main.start();
		}
	}

	/** Stop the music */
	public static void stop_main(Context context) {
		if (mp_main != null) {
			mp_main.stop();
			mp_main.release();
			mp_main = null;
		}
	}
}
